﻿using System;
using System.Threading.Tasks;
using System.Linq.Expressions;
using System.Collections.Generic;

namespace EaseDapper.Interface
{
    public interface IQueryExpressions<T> where T : class
    {
        public IQueryExpressions<T> Where(Expression<Func<T, bool>> expression);
        public IQueryExpressions<T> With<In>(Expression<Func<T, object>> expression1, Expression<Func<In, object>> expression2, IQueryExpressions<In> query, WithPattern type = WithPattern.In) where In : class;
        public IQueryExpressions<T> Between(Expression<Func<T, object>> expression, object smallerValue, object largerValue);
        public IQueryExpressions<T> Exist<In>(IQueryExpressions<In> query, ExistPattern type = ExistPattern.Exist) where In : class;
        public IQueryExpressions<T> GroupBy(Expression<Func<T, object>> expression);
        public IQueryExpressions<T> OrderBy(Expression<Func<T, object>> expression, OrderPattern type = OrderPattern.Asc);
        public IQueryExpressions<T> Having(Expression<Func<T, bool>> expression);
        public IQueryExpressions<T> Or(params Expression<Func<T, bool>>[] expressions);
        public IQueryExpressions<T> Take(int value);
        public T First();
        public Task<T> FirstAsync();
        public List<T> ToList();
        public Task<List<T>> ToListAsync();
        public bool Any();
    }
}
